package org.a.a.a;

import java.io.OutputStream;
import java.util.LinkedList;

public final class a extends OutputStream
{
  private static final byte[] a = new byte[0];
  private final e b;
  private final LinkedList c;
  private int d;
  private byte[] e;
  private int f;

  private a()
  {
    LinkedList localLinkedList = new LinkedList();
    this.c = localLinkedList;
    this.b = null;
    byte[] arrayOfByte = new byte[500];
    this.e = arrayOfByte;
  }

  private void a()
  {
    int i = this.d;
    int j = this.e.length;
    int k = i + j;
    this.d = k;
    int m = Math.max(this.d >> 1, 1000);
    if (m > 262144)
      m = 262144;
    LinkedList localLinkedList = this.c;
    byte[] arrayOfByte1 = this.e;
    boolean bool = localLinkedList.add(arrayOfByte1);
    byte[] arrayOfByte2 = new byte[m];
    this.e = arrayOfByte2;
    this.f = 0;
  }

  public final void close()
  {
  }

  public final void flush()
  {
  }

  public final void write(int paramInt)
  {
    int i = this.f;
    int j = this.e.length;
    if (i >= j)
      a();
    byte[] arrayOfByte = this.e;
    int k = this.f;
    int m = k + 1;
    this.f = m;
    int n = (byte)paramInt;
    arrayOfByte[k] = (byte) n;
  }

  public final void write(byte[] paramArrayOfByte)
  {
    int i = paramArrayOfByte.length;
    write(paramArrayOfByte, 0, i);
  }

  public final void write(byte[] paramArrayOfByte, int paramInt1, int paramInt2)
  {
    int i = paramInt2;
    int j = paramInt1;
    while (true)
    {
      int k = this.e.length;
      int m = this.f;
      int n = Math.min(k - m, i);
      if (n > 0)
      {
        byte[] arrayOfByte = this.e;
        int i1 = this.f;
        System.arraycopy(paramArrayOfByte, j, arrayOfByte, i1, n);
        int i2 = j + n;
        int i3 = this.f + n;
        this.f = i3;
        i -= n;
      }
      if (i <= 0)
        break;
      a();
    }
  }
}

/* Location:           E:\AndroidDecompiler\jd-gui-0.3.3.windows\newrclasses.dex.dex2jar.jar
 * Qualified Name:     org.a.a.a.a
 * JD-Core Version:    0.6.0
 */